package com.his.service;

import com.his.commons.core.dto.PageInfo;
import com.his.commons.core.exception.HisException;
import com.his.controller.form.ModifyDepartmentForm;
import com.his.controller.form.NewDepartmentForm;
import com.his.controller.form.PageForm;
import com.his.controller.info.DepartmentAndDisInfo;
import com.his.controller.info.DepartmentInfo;
import com.his.model.Department;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 梅津铧
 * @since 2022-03-22
 */
public interface DepartmentService extends IService<Department> {

    /**
     * 创建科室及下属诊室
     * @param newDepartmentForm  新科室信息
     */
    boolean increaseDepartment(NewDepartmentForm newDepartmentForm) throws HisException;

    /**
     * 更正科室及诊室信息
     * @param modifyDepartmentForm  更正的科室信息
     */
    boolean modifyDepartment(ModifyDepartmentForm modifyDepartmentForm) throws HisException;

    /**
     * 获取所有科室信息
     * @param pageForm 分页信息
     * @return  每页科室信息
     */
    PageInfo<DepartmentInfo> obtainDepartments(PageForm pageForm) throws HisException;

    /**
     * 根据科室编号/名称获取科室信息
     * @param condition  科室编号/名称
     * @return  科室信息
     */
    DepartmentInfo obtainByCondition(String condition) throws HisException;

    /**
     * 获取有诊室的科室信息
     * @return  科室信息
     */
    List<DepartmentAndDisInfo> ObtainHasDis() throws HisException;

    /**
     * 解散科室及下属诊室
     * @param departmentId  科室id
     */
    boolean logoutById(Integer departmentId) throws HisException;

    /**
     * 获取无诊室的科室信息
     * @return  科室信息
     */
    List<DepartmentAndDisInfo> ObtainHasNotDis() throws HisException;
}
